﻿@model QuanLyGiaoVuUI.Models.GiangVien.QuanLyDeTaiViewModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_blueWhaleLayout.cshtml";
}

@{Html.RenderPartial("QuanLyDeTaiMenuPartial");}

<div id="main" class="grid_10">
    <!--  start page-heading -->

    <div id="page-heading" class="box round first grid">
        <h2>Danh sách đề tài giảng viên</h2>
    <!-- end page-heading -->
    <div class="block">   
                        
                <div id="quanlydetai-left">
                    <div>
                        <div>         
                            <span>Chọn tỉ lệ hoàn thành:</span>                   
                            <span>
                                <select id="chonTiLe">
                                    <option value="@QuanLyGiaoVuService.Utilities.ThamSoConstantUtility.TATCATIENDO">Tất Cả</option>
                                    <option value="@QuanLyGiaoVuService.Utilities.ThamSoConstantUtility.DUOCBAOCAOTOTNGHIEP">Đủ ĐK Bảo Vệ</option>
                                    @for (int i = 10; i <= 100;i+=10 )
                                    {
                                        <option value="@i">@i %</option>
                                    }                                    
                                </select>
                            </span>
                            <span><a href="#" id="xemTiLeTienDoDeTai">Xem</a>
                             </span>
                        </div>                        
                    </div>
                    <br />
                    <table class="data display datatable">
                        <tr>
                            <th class="sorting">STT</th>
                            <th class="sorting">Tên Đề Tài</th>
                            <th class="sorting">GVHD1</th>
                            <th class="sorting">GVHD2</th>                            
                            <th class="sorting">Mô Tả</th>
                            <th class="sorting">Tiến Độ (SL)(%)</th>                            
                        </tr>
                        @{var count = 0; var stt = 1;}
                        @foreach (var detai in Model.danhSachDeTai)
                        {
                            <tr class="gradeA @(++count % 2 == 0 ? "even" : "odd")">
                                <td class="odd gradeX">@(stt++)</td>
                                <td class="odd gradeX">@detai.TenDeTai</td>
                                <td class="odd gradeX">@detai.GiangVien1.HoTenGV</td>
                                <td class="odd gradeX">@detai.GiangVien2.HoTenGV</td>                                
                                <td class="odd gradeX">@Html.Raw(detai.MoTa)</td>    
                                <td><a class="xemtiendo" href="#" rel="@detai.MaDeTai" data="@detai.TenDeTai">Xem tiến độ @detai.GhiChu</a></td>                            
                            </tr>
                        }
                    </table>
                </div>
@*                <div id="quanlydetai-bottom">
                    <div><h2>Tiến độ đề tài: <span id="quanly-tendetai"></span></h2></div>
                    <div><input type="hidden" id="currentID" value="" /></div>
                    <div id="quanlytiendo-main">

                    </div>                                                                               
                </div>*@

    </div>
</div>
</div>

<div class="clear">&nbsp;</div>
<div id="xemTiLeTienDoDeTaiDialog"></div>
<div id="xemTienDoDeTaiDialog"></div>
<script>
    $(document).ready(function () {
        //$('.xemtiendo').click(function () {
        //    var madetai = $(this).attr("rel");
        //    var tendetai = $(this).attr("data");
        //    $('#quanly-tendetai').html(tendetai);
        //    $("#currentID").val(madetai);
        //    //alert(madetai);
        //    $("#quanlytiendo-main").load("/TienDoDeTai/TienDoDeTai/" + madetai);
        //});

        $("#xemTienDoDeTaiDialog").dialog({
            autoOpen: false, modal: true, width: 800, height: "auto", title: "Sửa đề tài"
        });
        $("#xemTiLeTienDoDeTaiDialog").dialog({
            autoOpen: false, modal: true, width: 800, height: "auto", title: "Thống kê tiến độ đề tài"
        });
        $('.xemtiendo').click(function () {
            var madetai = $(this).attr("rel");
            $("#xemTienDoDeTaiDialog").load("/TienDoDeTai/TienDoDeTai/" + madetai);
            $("#xemTienDoDeTaiDialog").dialog("open");
        });
        $('#xemTiLeTienDoDeTai').click(function () {
            var tile = $('#chonTiLe').val();
            $("#xemTiLeTienDoDeTaiDialog").load("/TienDoDeTai/ThongKeDeTai?tile=" + tile);
            $("#xemTiLeTienDoDeTaiDialog").dialog("open");
        });
    });    
</script>